import React, { Component } from 'react'
import Todo from './Todo';

export default class TodoList extends Component {
  render() {
    const { list, toggleClick } = this.props
    return (
      <ul>
        {
            list.map((item) => {
                return (
                    <Todo onClick={() => {toggleClick(item.id)}} key={item.id} {...item}></Todo>
                )
            })
        }
      </ul>
    )
  }
}
